<?php
$q = $db->uzklausa("SELECT id, nick, reg_data, login_data, gim_data, avatar, taskai FROM users WHERE `taskai` > 0 ORDER BY `taskai` DESC LIMIT 10");
$i = ''; $text = '';
while ($row = mysql_fetch_assoc($q)) {
	//?id,47;m,3
	$i++;
	if ($i == 1) { $img = "<img src=\"images/icons/rosette.png\" alt=\"o\" class=\"middle\" border=\"0\"/>"; }
	elseif ($i == 2) { $img = "<img src=\"images/icons/medal_gold_2.png\" alt=\"o\" class=\"middle\" border=\"0\"/>"; }
	elseif ($i == 3) { $img = "<img src=\"images/icons/medal_silver_2.png\" alt=\"o\" class=\"middle\" border=\"0\"/>"; }
	elseif ($i == 4) { $img = "<img src=\"images/icons/medal_bronze_2.png\" alt=\"o\" class=\"middle\" border=\"0\"/>"; }
	else { $img = "<img src=\"images/icons/bullet_star.png\" alt=\"o\" class=\"middle\" border=\"0\"/>"; }
	$text .= "<div class=\"sarasas\"><br/><b>".$i."</b> $img <a href='?id,47;m,".$row['id']."' title=\"header=[".$row['nick']."] body=[<br/><center>
	<img src='".((!empty($row['avatar']))?$row['avatar']:'images/avatars/no_image.jpg')."' alt='avatar'/></center>
	<p>Nick: <b>".$row['nick']."</b><br/>
	Taškai: <b>".$row['taskai']."</b><br/>
	Amžius: <b>".amzius($row['gim_data'])."</b>m.<br/>
	Užsiregistravo: <b>".$row['reg_data']."</b><br/>
	Lankėsi: <b>".kada($row['login_data'])."</b></p>
	] cssbody=[sarasas] cssheader=[title] fade=[on]\">".$row['nick']."
	</a> (".$row['taskai'].")</div>\n";
}
lentele("TOP10",$text,"Lankytoju top"); unset($text,$i,$img,$row,$q,$text);
?>
